<!--
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author FIRE
-->
<template>
  <PageWrapper :sidebarWidth="350">
    <template #sidebar>
      <BasicTree
        :title="t('转换类型')"
        :search="true"
        :toolbar="true"
        :api="basRefColTreeData"
        :params="{ isShowCode: false }"
        :defaultExpandLevel="2"
        @select="handleSelect"
      />
    </template>
    <ListView :treeCode="treeCode" :treeName="treeName" />
  </PageWrapper>
</template>
<script lang="ts">
  export default defineComponent({
    name: 'ViewsBasRefBasRefColIndex',
  });
</script>
<script lang="ts" setup>
  import { defineComponent, ref } from 'vue';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { PageWrapper } from '/@/components/Page';
  import { BasicTree } from '/@/components/Tree';
  import { basRefColTreeData } from '/@/api/bas/ref/basRefCol';
  import ListView from './list.vue';

  const { t } = useI18n('bas.ref.basRefCol');
  const treeCode = ref<string>('');
  const treeName = ref<string>('');

  function handleSelect(keys: string[], { node }) {
    treeCode.value = keys[0];
    treeName.value = node._name;
  }
</script>
